<template>
    <div v-loading="loading" class="app-container">
        <el-descriptions :model="processOrder" :title="'订单编号：' + processOrder.orderCode">

            <!-- <template slot="extra">
                <el-button type="primary" size="small" @click="editInfo">编辑</el-button>
            </template> -->

            <el-descriptions-item label="项目名称">{{ processOrder.proTitle }}</el-descriptions-item>
            <el-descriptions-item label="图号">{{ processOrder.graphid }}</el-descriptions-item>
            <el-descriptions-item label="业务单元">{{ processOrder.businessUnit }}</el-descriptions-item>
            <el-descriptions-item label="用料部门">{{ processOrder.deptName }}</el-descriptions-item>
            <el-descriptions-item label="机组编号">{{ processOrder.unitCode }}</el-descriptions-item>
            <el-descriptions-item label="计划数量">{{ processOrder.planNum }}</el-descriptions-item>
            <el-descriptions-item label="订单时间">{{ processOrder.createTime }}</el-descriptions-item>
        </el-descriptions>

        <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
            <el-form-item prop="searchValue">
                <el-input v-model="queryParams.searchValue" placeholder="请输入订单编号、业务单元、项目名称、图号等" clearable
                    style="width: 340px" @keyup.enter.native="handleQuery" />
            </el-form-item>

            <el-form-item>
                <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
            </el-form-item>

            <el-form-item>
                <el-button type="primary" plain icon="el-icon-document-copy" size="mini"
                    @click="handleSplit">子任务拆分</el-button>
                <el-button type="primary" plain icon="el-icon-s-promotion" size="mini" @click="handleIssue">订单下发</el-button>
                <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">任务新增</el-button>
            </el-form-item>

        </el-form>

        <el-row :gutter="10" class="mb8">
            <el-col :span="1.5">
                <el-button type="success" v-show="!isEdit" plain icon="el-icon-edit-outline" size="mini"
                    @click="handleEdit">编辑</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="primary" v-show="isEdit" plain icon="el-icon-circle-check" size="mini"
                    @click="handleSure">确认</el-button>
            </el-col>
            <el-col :span="1.5">
                <el-button type="danger" v-show="isEdit" plain icon="el-icon-circle-close" size="mini"
                    @click="handleCancel">取消</el-button>
            </el-col>

        </el-row>

        <el-table ref="singleTable" :data="tableData" highlight-current-row @current-change="handleCurrentChange"
            style="width: 100%" border>
            <el-table-column type="index" label="序号" width="50">
            </el-table-column>
            <el-table-column property="rawMaterialCode" label="材料编号" width="130">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.rawMaterialCode }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.rawMaterialCode"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="materialName" label="材料名称" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.materialName }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.materialName"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="standard" label="规格" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.standard }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.standard"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="model" label="型号" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.model }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.model"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="rawMaterialSize" label="标准" width="150">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.rawMaterialSize }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.rawMaterialSize"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="processExlpain" label="加工说明" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.processExlpain }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.processExlpain"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="num" label="下料数量" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.num }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        onkeyup="value=value.replace(/[^\d]/g,'')" v-model="scope.row.num"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="partNumber" label="零件图号" width="200">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.partNumber }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.partNumber"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="childTaskCode" label="子任务号" width="210">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.childTaskCode }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.childTaskCode"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="customTitle" label="部件名称" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.customTitle }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.customTitle"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="laySize" label="下料尺寸" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.laySize }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.laySize"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="weight" label="重量" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.weight }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.weight"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="unit" label="单位" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.unit }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.unit"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="isPress" label="是否受压件" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.isPress == 0 ? '否' : '是' }}</span>
                    <el-select v-model="scope.row.isPress" placeholder="请选择" size="mini"
                        v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId">
                        <el-option size=" mini" v-for="item in pressOptions" :key="item.value" :label="item.label"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </template>
            </el-table-column>
            <el-table-column property="batchCode" label="批次号" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.batchCode }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.batchCode"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="realNum" label="实际下料数量" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.realNum }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        onkeyup="value=value.replace(/[^\d]/g,'')" v-model="scope.row.realNum"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="requireTime" label="下料完成时间" width="160">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.requireTime }}</span>
                    <el-date-picker v-model="scope.row.requireTime" type="date" placeholder="选择日期" format="yyyy-MM-dd"
                        :editable="false" value-format="yyyy-MM-dd" style="width: 100%" size="mini"
                        v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId">
                    </el-date-picker>
                </template>
            </el-table-column>
            <el-table-column property="teamName" label="班组长信息" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.teamName }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.teamName"></el-input>
                </template>
            </el-table-column>
            <el-table-column property="remark" label="备注" width="120">
                <template scope="scope">
                    <span
                        v-show="!isEdit || currentRow == null || (currentRow != null && scope.row.orderId != currentRow.orderId)">{{
                            scope.row.remark }}</span>
                    <el-input size="mini" v-show="isEdit && currentRow != null && scope.row.orderId == currentRow.orderId"
                        v-model="scope.row.remark"></el-input>
                </template>
            </el-table-column>
            <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120">
                <template slot-scope="scope">
                    <el-button size="mini" type="text" icon="el-icon-video-pause"
                        @click="handleStop(scope.row)">暂停</el-button>
                    <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
                </template>
            </el-table-column>
        </el-table>


        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
            :disabled="isEdit" @pagination="getProOrderDetailList" />

        <!-- 拆分子任务对话框 -->
        <el-dialog title="拆分子任务" :visible.sync="dialogTaskVisible" width="30%">
            <el-form>
                <el-form-item label="请输入数量">
                    <el-input v-model="taskNum" autocomplete="off" onkeyup="value=value.replace(/[^\d]/g,'')"></el-input>
                </el-form-item>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="taskCancel">取 消</el-button>
                <el-button type="primary" @click="taskSure">确 定</el-button>
            </div>
        </el-dialog>

        <!-- 新增订单对话框 -->
        <el-dialog title="新增任务" :visible.sync="addTask" width="80%" append-to-body>
            <el-form :rules="rules" ref="formTask" :model="formTask" label-width="120px">
                <el-row>
                    <el-col :span="8">
                        <el-form-item label="材料编号" prop="rawMaterialCode" size="mini">
                            <el-input v-model="formTask.rawMaterialCode" placeholder="请输入材料编号" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="材料名称" prop="materialName" size="mini">
                            <el-input v-model="formTask.materialName" placeholder="请输入材料名称" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="规格" prop="standard" size="mini">
                            <el-input v-model="formTask.standard" placeholder="请输入规格" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="型号" prop="model" size="mini">
                            <el-input v-model="formTask.model" placeholder="请输入型号" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="标准" prop="rawMaterialSize" size="mini">
                            <el-input v-model="formTask.rawMaterialSize" placeholder="请输入标准" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>

                    <el-col :span="8">
                        <el-form-item label="加工说明" prop="processExlpain" size="mini">
                            <el-input v-model="formTask.processExlpain" placeholder="请输入加工说明" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="下料数量" prop="num" size="mini">
                            <el-input v-model="formTask.num" placeholder="请输入下料数量" maxlength="20" clearable
                                onkeyup="value=value.replace(/[^\d]/g,'')" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="零件图号" prop="partNumber" size="mini">
                            <el-input v-model="formTask.partNumber" placeholder="请输入零件图号" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="部件名称" prop="customTitle" size="mini">
                            <el-input v-model="formTask.customTitle" placeholder="请输入部件名称" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="下料尺寸" prop="laySize" size="mini">
                            <el-input v-model="formTask.laySize" placeholder="请输入下料尺寸" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="重量" prop="weight" size="mini">
                            <el-input v-model="formTask.weight" placeholder="请输入重量" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="单位" prop="unit" size="mini">
                            <el-input v-model="formTask.unit" placeholder="请输入单位" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="是否受压件" prop="isPress" size="mini">
                            <el-select v-model="formTask.isPress" placeholder="请选择" style="width: 100%">
                                <el-option v-for="item in pressOptions" :key="item.value" :label="item.label"
                                    :value="item.value">
                                </el-option>
                            </el-select>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="批次号" prop="batchCode" size="mini">
                            <el-input v-model="formTask.batchCode" placeholder="请输入批次号" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="实际下料数量" prop="realNum" size="mini">
                            <el-input v-model="formTask.realNum" placeholder="请输入实际下料数量" maxlength="20" clearable
                                onkeyup="value=value.replace(/[^\d]/g,'')" />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="下料完成时间" prop="requireTime" size="mini">
                            <el-date-picker v-model="formTask.requireTime" type="date" placeholder="选择日期" :editable="false"
                                format="yyyy-MM-dd" value-format="yyyy-MM-dd" style="width: 100%" size="mini">
                            </el-date-picker>
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="班组长信息" prop="teamName" size="mini">
                            <el-input v-model="formTask.teamName" placeholder="请输入班组长信息" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                    <el-col :span="8">
                        <el-form-item label="备注" prop="remark" size="mini">
                            <el-input v-model="formTask.remark" placeholder="请输入备注" maxlength="20" clearable />
                        </el-form-item>
                    </el-col>
                </el-row>
            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button type="primary" @click="submitTaskAdd">确 定</el-button>
                <el-button @click="submitTaskCancel">取 消</el-button>
            </div>
        </el-dialog>
    </div>
</template>
  
<script>
import { getProOrderInfo, getProOrderDetail, addProOrderDetail, updateProOrderDetail, delOrderDetailById, splitOrderTask } from "@/api/process/order";


export default {
    name: "OrderDetail",
    data() {
        return {
            // 遮罩层
            loading: true,
            //订单编号
            orderCode: undefined,
            // 订单信息
            processOrder: {},
            //新增任务表单
            formTask: {},
            //是否编辑
            isEdit: false,
            //新增任务弹框
            addTask: false,
            // 总条数
            total: 0,
            // 查询参数
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                searchValue: undefined,
                orderCode: undefined
            },
            //加工订单详情的任务
            tableData: [],
            //当前选择的任务行
            currentRow: null,
            //拆分子任务弹窗
            dialogTaskVisible: false,
            //拆分子任务数量
            taskNum: undefined,
            //受压件
            pressOptions: [{
                value: '1',
                label: '是'
            }, {
                value: '0',
                label: '否'
            }],
            rules: {
                rawMaterialCode: [
                    { required: true, message: '请输入材料编号', trigger: 'blur' }
                ],
                materialName: [
                    { required: true, message: '请输入材料名称', trigger: 'blur' }
                ],
                standard: [
                    { required: true, message: '请输入规格', trigger: 'blur' }
                ],
                model: [
                    { required: true, message: '请输入型号', trigger: 'blur' }
                ],
                num: [
                    { required: true, message: '请输入下料数量', trigger: 'blur' }
                ],
                processExlpain: [
                    { required: true, message: '请输入加工说明', trigger: 'blur' }
                ],
                partNumber: [
                    { required: true, message: '请输入零件图号', trigger: 'blur' }
                ],
                customTitle: [
                    { required: true, message: '请输入部件名称', trigger: 'blur' }
                ],
                laySize: [
                    { required: true, message: '请输入下料尺寸', trigger: 'blur' }
                ],
                weight: [
                    { required: true, message: '请输入重量', trigger: 'blur' }
                ],
                unit: [
                    { required: true, message: '请输入单位', trigger: 'blur' }
                ],
                laySize: [
                    { required: true, message: '请输入下料尺寸', trigger: 'blur' }
                ],
                requireTime: [
                    { required: true, message: '请选择下料时间', trigger: 'blur' }
                ],
            },
        };
    },

    created() {
        this.getParams()
    },

    watch: {
        '$route'(val, from) {//监听到路由（参数）改变
            if (typeof val.query.orderCode != 'undefined') {
                this.getParams()
            }
        }
    },

    methods: {
        // 取到路由带过来的参数 
        getParams() {
            this.orderCode = this.$route.query.orderCode;
            this.queryParams.orderCode = this.$route.query.orderCode;
            this.getProcessOrder(this.orderCode)
        },

        /** 搜索按钮操作 */
        handleQuery() {
            this.queryParams.pageNum = 1;
            this.getProOrderDetailList();
        },

        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm("queryForm");
            this.queryParams.searchValue = undefined;
            this.handleQuery();
        },


        //获取加工订单
        getProcessOrder(orderCode) {
            this.loading = true;
            getProOrderInfo(orderCode).then(response => {
                this.processOrder = response.data
                this.loading = false;
                this.getProOrderDetailList();
            }
            );
        },

        //获取加工订单详情的任务
        getProOrderDetailList() {
            this.loading = true;
            getProOrderDetail(this.queryParams).then(response => {
                this.tableData = response.rows;
                this.total = response.total;
                this.loading = false;
            }
            );
        },

        //编辑订单info
        editInfo() {
            console.log(this.orderCode)
        },

        //列表单选触发
        handleCurrentChange(val) {
            this.currentRow = val;
        },
        //编辑
        handleEdit() {
            if (this.currentRow == undefined || this.currentRow == null) {
                this.$message({
                    message: '编辑前请先选择任务！',
                    type: 'warning'
                });
            } else {
                this.isEdit = true;
            }

        },
        //确定
        handleSure() {
            if (this.currentRow.orderId != undefined) {
                updateProOrderDetail(this.currentRow).then(response => {
                    this.$modal.msgSuccess("修改成功");
                    this.isEdit = false;
                    this.handleQuery();
                });
            }
        },
        //取消
        handleCancel() {
            this.isEdit = false;
            this.getProOrderDetailList();
        },

        //删除当前任务
        handleDelete(row) {
            delOrderDetailById(row.orderId).then(response => {
                this.$modal.msgSuccess("删除成功");
                this.handleQuery();
            })
        },
        //子任务拆分
        handleSplit() {
            if (this.currentRow == undefined || this.currentRow == null) {
                this.$message({
                    message: '拆分子任务前，请先选择任务！',
                    type: 'warning'
                });
            } else if (this.isEdit) {
                this.$message({
                    message: '您正处于编辑中，禁止拆分！',
                    type: 'warning'
                });
            } else if (this.currentRow.num < 2) {
                this.$message({
                    message: '下料数量不足，禁止拆分！',
                    type: 'warning'
                });
            } else {
                this.dialogTaskVisible = true;
            }
        },
        //新增任务
        handleAdd() {
            this.addTask = true;

        },
        //订单下发
        handleIssue() {

        },
        //任务暂停
        handleStop() {

        },
        //拆分子任务取消
        taskCancel() {
            this.dialogTaskVisible = false;
            this.taskNum = undefined;

        },
        //拆分子任务确认
        taskSure() {
            if (this.taskNum > this.currentRow.num) {
                this.$message({
                    message: '输入的拆分数量不能大于下发数量',
                    type: 'warning'
                });
            } else {

                const data = {
                    orderId: this.currentRow.orderId,
                    taskNum: this.taskNum
                }

                splitOrderTask(this.currentRow.orderId, this.taskNum).then(response => {
                    this.$modal.msgSuccess("拆分子任务成功");
                    this.dialogTaskVisible = false;
                    this.taskNum = undefined;
                    this.handleQuery();
                });


            }
        },

        //新增任务提交
        submitTaskAdd() {
            this.$refs["formTask"].validate(valid => {
                if (valid) {
                    this.formTask.orderCode = this.orderCode
                    addProOrderDetail(this.formTask).then(response => {
                        this.$modal.msgSuccess("新增成功");
                        this.handleQuery();
                        this.submitTaskCancel();
                    });

                }
            })

        },
        //新增任务取消
        submitTaskCancel() {
            this.addTask = false;
            this.formTask = {};
            this.$refs.formTask.clearValidate();
        },
    }




};
</script>